package com.blog.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.blog.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Copyright (C), 2022
 * Author: 苏大大
 * Date: 2022-04-15 16:03
 * FileName: UserMapper
 * Description:
 */
@Repository //表示为持久层
@Mapper
public interface UserMapper extends BaseMapper<User> {

    /***
     * 登录
     * @param account
     * @return
     */
    User Login(String account);

    /***
     * 修改用户头像
     * @param user
     * @return
     */
    int updateAvatar(User user);

    /***
     * 验证用户名称是否被占用
     * @param username
     * @return
     */
    int queryUserName(String username);

    /***
     * 验证手机号称是否被占用
     * @param phone
     * @return
     */
    User queryUserPhone(String phone);

    /***
     * 获取所有用户头像地址
     * @return
     */
    List<String> queryAvatarAll();

    /***
     * 获取用户密码
     * @param account
     * @return
     */
    String getPassword(String account);
}
